package chapter03.Example3334;
class Student03{
    String name;                         //声明姓名属性
    int age;                          //声明年龄属性
    void read(){
        System.out.println("大家好，我是"+name);
    }
}
public class Example03 {
    public static void main(String[] args){
        Student03 stu = new Student03();  //创建Student对象
        stu.name = "张三";               //为stu1对象的name属性赋值
        stu.age = -18;
        stu.read();                     //调用对象方法
    }
}
